import request from "@/utils/request.js";

export function uploadFile(data) {
  return request({
    url: `${window.scjConfig.uploadUrl}/goodsType/updateGoodsType`,
    method: 'post',
    data
  })
}
// 获取上传文件token
export function getUploadToken() {
  return request({
    url: `${window.scjConfig.uploadUrl}/prepare/uploadtoken`,
    method: 'post',
    headers: {
      appId: 'standard',
      appSecret: '123456'
    },
    noToken: true,
    params: {
      fileBucket: 'standard',
      userId: 123
    },
    data: {}
  })
}
// 获取下载文件token
export function getDownloadtoken(id) {
  return request({
    url: `${window.scjConfig.uploadUrl}/prepare/downloadtoken`,
    method: 'post',
    headers: {
      appId: 'standard',
      appSecret: '123456'
    },
    noToken: true,
    params: {
      fileId: id,
      userId: 123
    },
    data: {}
  })
}
export function downloadFile(params) {
  return request({
    url: `${window.scjConfig.uploadUrl}/downloadFile`,
    method: 'get',
    params
  })
}
